#ifndef LINE_H
#define LINE_H

#include "myshape.h"

class Line : public MyShape
{
public:
    Line(const QPointF &startPoint, const QPointF &endPoint, const QColor &color);

    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;

    QPointF getEndPoint() const override { return endPoint_; }
    void setEndPoint(const QPointF &newEndPoint) override { endPoint_ = newEndPoint; }

    bool isPointNear(const QPointF &point) const override;
    void highlightControlPoints(const QPointF &point) override;

private:
    QPointF endPoint_;
    bool startHighlighted_ = false;
    bool endHighlighted_ = false;
};

#endif // LINE_H
